import request from '@/utils/request'

export function setErrMsg(data) {
  return request({
    url: `/md/plm/setErrMsg?errMsg=` + data,
    method: 'get'
  })
}

export function getStepNo(data) {
  return request({
    url: `/md/plm/getWorkStep`,
    method: 'post',
    data: data
  })
}

export function getErrMsg() {
  return request({
    url: `/md/plm/getErrMsg`,
    method: 'get'
  })
}

export function handleOauth() {
  return request({
    url: `http://127.0.0.1:8080/sipmweb/api/oauth?uname=adm&passwd=25d55ad283aa400af464c76d713c07ad&f=true`,
    method: 'get'
  })
}

export function handlePageId(errMsg, name, ItemCode) {
  return request({
    url: `http:// 127.0.0.1:8080/sipmweb/api/${errMsg} /search/${name}?key=${ItemCode}V2&start=0&size=10`,
    method: 'get'
  })
}

export function handleDetail(rid, id) {
  return request({
    url: `http://127.0.0.1:8080/sipmweb/web/search/detail?rid=${rid}&id=${id}`,
    method: 'get'
  })
}
// 根据物料和版本获取所有工步信息
export function getAllWorkStep(item, version) {
  return request({
    url: `md/plm/getAllWorkStep?item=${item}&version=${version}`,
    method: 'get'
  })
}
